Alchemy Help:
The view from 30,000 feet


[Contents] [Index]

Overview

About this manual

The Alchemy manual is intended to explain how Alchemy works and to describe how Alchemy is used to create web sites and upload them to a server. The manual does not explain how to write HTML code, how CGI-BIN works, what Java is, how to connect to your service provider, where to put CGI-BIN files on the server, or anything else except how to use Alchemy.



How Alchemy works

Now hear this: Alchemy is not an HTML editor! Alchemy is an plug-in development environment for the World Wide Web. It manages all of the files that make up your web site and allows you to automatically upload them to a web server by simply pressing a button. Unless you are a programmer, you have never used a software tool like this before. Please take the time to read this section of the manual so that you understand what Alchemy does and how to use it. Alchemy is not complicated to learn, but if you don't read at least this section of the manual you will be confused when you try to use the software since you won't understand the basic concepts.

Let's start this discussion by saying that millions of C, C++, BASIC, Pascal and (insert your favorite programming language here) programmers have walked this path before you, and have made the transition from command-line tools and single-source editors to an integrated environment. You will find that working this way is a much more natural approach to developing your web site, and it will also save you an incredible amount of time. The Alchemy environment is very flexible in that you are not required to use the built-in tools and editors. We have designed it in such a way that it integrates seamlessly with most third-party applications, so you can use whatever external tools you are comfortable with. For example, if you want to use an HTML editor such as HotDog® or HoTMetaL® instead of the internal Web Editor, just plug it in by telling Alchemy where to find the application. The same is true for image editors, web browsers and just about any other application you can think of.

Unlike HTML editors, which focus on creating individual HTML files, Alchemy is based on the concept of a project. All of the elements of your web site go into a project file which is managed by Alchemy. You access your project via the Project Window, which is the main Alchemy application window. The Project Window keeps track of the contents of your HTML files and displays them graphically, and you can edit or view any of the project elements (graphics files, HTML source, CGI-BIN scripts, audio clips, Java applets, etc.) by clicking them with the mouse. In addition, you can easily upload your project to your web server at any time by clicking the Upload button. Since Alchemy allows you to surf your web site on your PC, you do not need to connect to a server until you are ready to upload your project.

The downside of using an IDE's project-oriented approach is that you will probably need to work a bit differently than you have in the past. The basic premise of the Alchemy IDE is that you will create a directory on your PC, and you will upload your project to a matching directory on the server. In essence, the PC directory is an exact duplicate of the server directory. This will allow you to surf your web site on the PC with a web browser exactly as you would if you were connected to the server, but you do not need to be online while developing the web site. Here are the rules you need to follow in order to make this work:

1. All files go into the same directory
All of the files which make up your project (HTML documents, graphics files, Perl scripts, etc.) go into a single directory, which is known as the project directory. You will have a project directory on your local PC, and there will be a matching project directory on the server. While most developers create multiple subdirectories in order to make their files easier to manage (one for graphics files, one for HTML files, etc.) you cannot do this with Alchemy, and you don't need to since Alchemy manages the files for you. This makes no difference to Unix, the HTTP server or your users, but you will need to get over the mental hurdle of having a messy directory.

2. All files have DOS-style 8.3 file names
Since you will probably be crossing an operating system barrier (DOS to Unix/Mac/Windows NT/Who-knows-what), all of your files must have an 8.3 file name since it's the lowest common denominator. For example, don't name your home page "MySite.MyFirstHomePage.html", name it "homepage.htm". Note: Your server probably has strict naming requirements for the home page ("index.html", for example, which is not an 8.3 name) and Java applets (which must end with ".class"), among other things. You can configure Alchemy to automatically rename files while uploading them to the server; more on this later.

3. All files references are non-pathed
All references to files that are part of your web site (with the exception of CGI-BIN files, we'll discuss this in a minute) are non-pathed local file references. That's a mouthful, so here's what it means. Let's say that:

On your home page, the image tag would appear as "IMG SRC="welcome.gif"".
just the file name all by itself.

Likewise, if you have a link to your home page from another HTML file in your site, the Begin-anchor tag would appear as "A HREF="homepage.htm"", just the file name all by itself.

Note that this only applies to files that are part of your web site, i.e., files that you are creating on your PC and will be uploading to the server. You can still refer to files in other directories on the server or on other machines on the web, but Alchemy will ignore them as it will not consider them to be part of your project.

NOTE: Alchemy requires items 1 & 3 above due to a web browser limitation. Until very recently, browsers were not able to follow links into subdirectories when accessing local files. It appears that the major browser manufacturers are now addressing this limitation; the latest version of Netscape allows access to subdirectories while browsing locally. So, we will be removing requirements 1 & 3 shortly, and you will be able to have subdirectories in your project.

By following the above rules, what you are essentially doing is creating a web site on your PC which can be mirrored on your server. Not only can the contents of the project directory can be uploaded to the server without making any changes to the sources, but the web site will act just the same on your PC as it will on the server (with the constant exception of CGI-BIN, we'll get to that). This means that you can build and test your whole site off-line and then upload it to the server when you're ready. Of course, if you have references to other resources on the network (like "A HREF="http://www.cool-links.com") you'll still need to be on-line to test them from your PC.



The Messages Window

Under the Window pulldown menu in any Alchemy window, you can access the Messages Window. When performing any complex operation such as adding an HTML file to a project, uploading a project to a server or creating thumbnail graphics, Alchemy writes messages to a log file. The Messages Window is the viewer for the log file. If Alchemy encounters a problem during processing, it will log as much information as it can about the problem and then activate the Messages Window so that you can troubleshoot it. For example, if while parsing one of your HTML files Alchemy is unable to locate a graphics file that is referenced within the code, it will display the Messages Window and you will see the message "Warning: Unable to locate file "(filename here)". You can double-click on the error message to go to the line of code that caused the error. Project uploads, in particular, can be a source of problems because there are so many things that can go wrong; log-ins can fail for various reasons, operations can time out, file transfers can fail, you may not have access to a directory, etc. Whenever you encounter a problem during a project upload, you should check the Messages Window. By setting the View level to Level 3, you will be able to determine immediately what went wrong.



Getting your files to the server

One of the best things about Alchemy is that it will automatically upload your project to the server and set file access permissions for you. You just press the upload button and watch it go, there's no FTP or Telnet to hassle with. In addition, Alchemy keeps track of the date and time that each file is uploaded so that it only sends those files that you have made changes to, significantly reducing the amount of time you spend on-line. You can find a full discussion of this subject in the Project Window section of the manual, but here's an essential fact that you need to know up front:

There will be times when you have a file which is part of your project but Alchemy will not know where to upload it because it is not referred to using a non-pathed local reference. For example, let's say that you have a ZIP'ed file that you are allowing users to download from your FTP site. The reference on your HTML page would look something like "A HREF="ftp://www.mysite.com/myfile.zip"", but the actual file on the server would be something like "/pub/mysite/ftp/myfile.zip" and would not appear as such anywhere in the project. When reading the HTML source, Alchemy can figure out that it's supposed to upload the file "myfile.zip", but it has no way of knowing where to put it since the HREF does not contain the server directory name.

To deal with this situation, just add a new folder to your project in the Project window, indicate the server directory to associate with the folder and add the file to the folder. In the above example, you could create a folder named "FTP", associate it with the server directory "/pub/mysite/ftp", and add the file "myfile.zip" to the folder.



Uploading to an intranet server

If you're lucky enough to be building a web site on an intranet server, uploading your project is a snap. In the Project Window, just select the File/Export project to directory... menu item and select the intranet site's home directory.



About the home page

Most service providers require that you use a standard name for your web site's home page, and that name isn't always going to be DOS friendly. For example, the name "index.html" is quite common, but you can't use it on a DOS system, which needs an 8.3-style file name. Now, you may be thinking "But I use Windows 95, so I can name my files anything I want", which is true, but Alchemy is not a native Windows 95 application; it's a 16-bit app so that it will run on Windows 3.1, Windows for Workgroups and Windows 95. So while your file name will appear as "index.html" in the Windows 95 Explorer window, when you view it in Alchemy (or any other 16-bit Windows application) it's going to be something like "index~1.htm", which is not going to make your web server happy!

To get around this problem, Alchemy allows you to specify both local and server versions of the home page file name. In the above example, when you create or modify your project in the Project dialog you would set the server file name to "index.html" and the local file name to "index.htm". "index.htm" is the file you create on your PC. When you upload your project to the server, the file "index.htm" is sent to the server, and is then copied to the file "index.html". Note that we said copied, not renamed. This is because all of your HTML documents that have links to the home page are going to be looking for "index.htm", not "index.html". If you specify "index.html" in the links, Alchemy will not be able to find the file and you will not be able to surf your web site on the PC. Got it?

This may bother you at first, but it has a very interesting and beneficial side effect: you never access the actual home page "index.html" from within your web site. This means that the only time the actual home page is "touched" is when someone connects to your web site and the HTTP server delivers it to their web browser. After that, whenever they access a link within your site that takes them "back to the home page", they get "index.htm", not "index.html". Which means... that when you get your next activity report for your web site, the number of home page "hits" is going to be the actual number of people who visited your web site, and your counter that says "you are the ###th person to visit this site" will actually be true for a change!

Of course, your visitor's web browser probably caches the home page anyway, in which case you can ignore that last paragraph.



Java support

Alchemy provides excellent support for Java applets, but as with all other files you must adhere to the 8.3 file rule. Since Java applets are required to have a ".class" file name extension on the server, Alchemy will automatically rename the applet from the 8.3 name to its Unix equivalent when uploading it to the server, but you will need to specify the 8.3 name in a consistent manner. For example, if you have an applet named "StockTicker.class", its 8.3 name would be "stocktic.cla" (truncate the base name to 8 characters and the extension to 3 characters). When adding the file to your project, you would specify the File name on server as "StockTicker.class". (Select the file in the Project Window, right-click the mouse and select Properties... from the speed menu to access this field).



What about CGI-BIN?

There's always a fly in the ointment, isn't there? The problem with CGI-BIN (let's just call it CGI) is that it doesn't easily lend itself to testing on a PC. You can surf the non-CGI portions of your web site with your web browser, since all the browser is doing is loading files from the hard drive. Let's say, though, that you have a form in one of your HTML documents and you press the "Submit" button. Well, now we have a problem since the web browser expects to be connected to your HTTP server so that it can tell the server the name of the CGI script/executable to launch, and it will also be expecting data to come back to it over the HTTP link. In other words, we're not just loading files anymore.

The good new is, we have come up with a solution to this problem. The bad news is, it's not in the current release of Alchemy. In the next release, we intend to provide support for off-line testing of Perl scripts, along with any other scripting languages (Tcl, Unix shell, etc.) for which DOS interpreters exist. If you are using a Windows 3.x/95 server, you'll also be able to test CGI executables (i.e., .EXE's) but if your web site will end up on a Unix/Mac/etc. host then you're stuck with scripts.

In the meantime, we will provide as much CGI support as we can. The current version of Alchemy recognizes files with the following file name extensions as CGI files:

Alchemy also allows you to define a CGI directory on the server for your project. So, for example, let's say that your CGI directory is "/pub/cgi-bin/mycompany", and you have a form tag in your HTML document which looks this:

FORM METHOD="POST" ACTION="/cgi-bin/mysite/signup.pl"

Alchemy will assume that the file "signup.pl" is a Perl script which can be found in your project directory. When you upload your project to the server, Alchemy will copy the file to the CGI directory that you have defined for your project, "/pub/cgi-bin/mysite. Note that Alchemy will not attempt to copy the file to the directory "/cgi-bin/mysite" that is specified in the FORM tag, since it is most likely an aliased path and thus the transfer would fail.

In addition to automatically uploading CGI files that it understands, Alchemy creates a folder in the Project window called CGI-BIN which is associated with the CGI directory on the server. Anything you put in this folder will be copied to the CGI directory on the server when you upload your project, even if Alchemy doesn't recognize the file extension.

Okay, we said up front that we wouldn't explain anything about how to write CGI code, but here are some hints we've found useful in making your CGI development cycle a little bit shorter and a little less painful. These apply to DOS/Windows in general as well as to Alchemy:


A Next Wave communication. © Copyright 1996 Next Wave Software. All rights reserved. Feedback to feedback@stormsurge.com.